package Administrator.AdministratorMainFrame.AdministratorMainFrameController.Listener;

import javax.swing.*;
import java.awt.event.*;
import javax.swing.JOptionPane;

import Administrator.AdministratorMainFrame.AdministratorMainFrameView.*;
import Administrator.AdministratorMainFrame.AdministratorMainFrameModel.*;
import Administrator.AdministratorMainFrame.AdministratorMainFrameController.*;

public class MainFrameExitButtonListener implements ActionListener
{
	public MainFrameExitButtonListener(AdministratorMainFrameView view, AdministratorMainFrameModel model,
			AdministratorMainFrameController controller)
	{
		this.view = view;
		this.model = model;
		this.controller = controller;
	}
    public void actionPerformed(ActionEvent event)
    {
    	int option = JOptionPane.showConfirmDialog(view.frame, "Do you want to exit?");
    	if (option == JOptionPane.YES_OPTION)
    	{
    	    System.exit(0);
    	}
    }
    
    private AdministratorMainFrameView view;
    private AdministratorMainFrameModel model;
    private AdministratorMainFrameController controller;
}
